PTGSpec: G1 .

G1:  .
G1: G1 PatternSpec .

PatternSpec: PatternName ':' PatternBody .
PatternName: Identifier .
PatternBody: G2 .

G2:  .
G2: G2 Item .
G2: G2 Optional .

Optional: '{' G3 '}' .
G3: G3 Item .
G3: Item .

Item: CString .
Item: FunctionCall .
Item: Insertion .

FunctionCall: '[' FunctionName Arguments ']' .
FunctionName: Identifier .

Arguments: G4 .
G4:  .
G4: G4 Argument .
Argument: Insertion .

Insertion: '$' Index Type .
Index:  .
Index: Number .

Type:  .
Type: 'char' .
Type: 'double' .
Type: 'float' .
Type: 'int' .
Type: 'long' .
Type: 'pointer' .
Type: 'short' .
Type: 'string' .

